﻿namespace Smart.Service
{
    using System;
    using System.Runtime.InteropServices;

    public class Internet
    {
        [DllImport("wininet.dll", CharSet=CharSet.Auto)]
        private static extern bool InternetGetConnectedState(ref ConnectionInternetState lpdwFlags, int dwReserved);
        public static bool IsConnectedToInternet()
        {
            ConnectionInternetState lpdwFlags = 0;
            return InternetGetConnectedState(ref lpdwFlags, 0);
        }
    }
}

